<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="hardcode2013.*" %>

<%
String msg = SessionUtil.getMessage(request);
if (msg != null) {
	SessionUtil.removeMessage(request);
	%>
	<fieldset>
		<legend>Message</legend>
		<%=EncodeUtil.encodeHtml(msg)%>
	</fieldset>
	<%
}
String username = SessionUtil.getAuthUsername(request);
AccountProfile profile = null;
%>

<fieldset>
	<legend>Navigation</legend>
	<a href="/">Home</a><br>
	<%
	if (username != null) {
		profile = AccountServ.getAccountProfile(username);
		%>
		<a href="/account?action=logout_account&redirect=%2F">Logout</a><br>
		Username: <%= EncodeUtil.encodeHtml(profile.getUsername()) %><br>
		Account Type: <%= EncodeUtil.encodeHtml(String.valueOf(profile.getUseGoogle()).replace("true","Google").replace("false","Standard")) %><br>
		<% if (profile.getUseGoogle()) { %>
			Google Account: <%= EncodeUtil.encodeHtml(profile.getGoogleEmail()) %><br>
		<% } %>
		Is Administrator: <%= EncodeUtil.encodeHtml(String.valueOf(profile.getIsAdmin()).replace("true","Yes").replace("false","No")) %><br>
		<a href="/account.jsp">Account</a><br>
		<a href="/mail.jsp">Mail</a><br>
		<a href="/myitems.jsp">My Items</a><br>
		<a href="/search.jsp">Search</a><br>
		<%
		if (profile.getIsAdmin()) {
			%>
			<a href="/admin.jsp">Admin Panel</a><br>
			<%
		}
	} else {
		%>
		<a href="/login.jsp">Login / Register</a>
		<%
	}
	%>
</fieldset>